# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-plasma
pkgname=plasma-remotecontrollers
pkgver=5.27.10
pkgrel=0
pkgdesc="Translate various input device events into keyboard and pointer events"
url="https://invent.kde.org/plasma-bigscreen/plasma-remotecontrollers"
# armhf blocked by extra-cmake-modules
arch="all !armhf"
license="BSD-2-Clause AND (GPL-2.0-only OR GPL-3.0-only) AND CC0-1.0"
# For some reason there is no dep on so:libcec but it crashes without it
depends="libcec"
makedepends="
	extra-cmake-modules
	kcmutils5-dev
	kconfig5-dev
	kdeclarative5-dev
	ki18n5-dev
	knotifications5-dev
	kpackage5-dev
	kwindowsystem5-dev
	libcec-dev
	libevdev-dev
	plasma-workspace-dev
	qt5-qtbase-dev
	qt5-qtwayland-dev
	samurai
	solid5-dev
	"
case "$CARCH" in
	ppc64le) ;;
	*) makedepends="$makedepends xwiimote-dev" ;;
esac

subpackages="$pkgname-lang"
case "$pkgver" in
	*.90*) _rel=unstable;;
	*) _rel=stable;;
esac
_repo_url="https://invent.kde.org/plasma/plasma-remotecontrollers.git"
source="https://download.kde.org/$_rel/plasma/$pkgver/plasma-remotecontrollers-$pkgver.tar.xz
	uinput.conf
	"
options="!check" # No tests

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build

	install -Dm644 \
		"$srcdir"/uinput.conf \
		-t "$pkgdir"/etc/modules-load.d
}

sha512sums="
144804b601333452b19e295420f5181c8c7de495a5e6a83b89551986a2696f0c51b85329cc62f35156992c366fd5e92877059108532a805e36ea4a59fe84e338  plasma-remotecontrollers-5.27.10.tar.xz
a9b069ed121ffeee887e0583d8cb46035ecf1fa90a26a4ecb3aa11ff03178b2b08621f6676db6b2350f290694c04aabcf36f2ce3e0813a76dde9a33555edb112  uinput.conf
"
